<template>
  <view>
    <Navbar title="信息" bgColor="#fff" :hideBtn="true" :h5Show="false"></Navbar>
    <u-list height="88vh">
      <u-list-item v-for="(item, index) in indexList" :key="index">
        <view class="msg" @click="navigateTo(DIALOGUEPATH)" @longpress="onLongPress(item)">
          <view class="msg_avater">
            <image src="@/static/img/avatar.png" mode="widthFix" style="width: 50px"></image>
          </view>
          <view class="msg_conent">
            <h2>title</h2>
            <p>巴拉巴拉巴拉</p>
          </view>
          <view class="msg_time">
            <view>2024/05/08</view>
          </view>
        </view>
      </u-list-item>
    </u-list>
  </view>
</template>

<script>
import Navbar from '@/components/navbar/Navbar'
import { DIALOGUEPATH } from '@/constants/router/subPackages'
export default {
  components: {
    Navbar
  },
  data() {
    return {
      DIALOGUEPATH,
      indexList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
    }
  },
  methods: {
    navigateTo(url) {
      uni.navigateTo({
        url: url
      })
    },
    onLongPress(e) {
      console.log(e, 'e')
    }
  }
}
</script>

<style lang="scss" scoped>
* {
  padding: 0;
  margin: 0;
}

.msg {
  height: 60px;
  width: 100%;
  // background-color: skyblue;
  display: flex;
  align-items: center;
  border-bottom: 0.5px solid #ccc;
  border-top: 0.5px solid #ccc;

  .msg_avater {
    width: 60px;

    image {
      margin-left: 10px;
      border-radius: 25px;
    }
  }

  .msg_conent {
    height: 60px;

    h2 {
      padding-top: 5px;
    }

    p {
      width: 230px;
      font-size: 11px;
      line-height: 30px;
      color: #ccc;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  .msg_time {
    height: 60px;
    font-size: 14px;

    view {
      padding-top: 5px;
      color: #ccc;
    }
  }
}
</style>
